#!/usr/bin/env python
from os import path
Import('build env module')

env.Append(CPPDEFINES = ('TITANIUM_PROCESS_API_EXPORT', 1))

build.add_thirdparty(env, 'poco')
sources = Glob('*.cpp')
if build.is_win32():
    env.Append(CCFLAGS=['/MD', '/DUNICODE', '/D_UNICODE'])
    sources += Glob('win/*.cpp')
else:
    sources += Glob('posix/*.cpp')

if build.is_win32():
    env.Append(CCFLAGS=['/DUNICODE', '/D_UNICODE'])

build.mark_build_target(build.utils.CopyTree(Glob('*.js'), module.dir))
build.mark_build_target(env.SharedLibrary(
    path.join(module.dir, 'tiprocessmodule'), sources))
